package com.fzh.wangxiao.web.member.controller;
import com.fzh.wangxiao.utils.Result;
import com.fzh.wangxiao.web.member.service.TBizMemberService;
import com.fzh.wangxiao.web.req.AssignRequest;
import com.fzh.wangxiao.web.req.FollowListRequest;
import com.fzh.wangxiao.web.req.MemberListRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author fang
 * @since 2021-01-05
 */
@RestController
@RequestMapping("/web/member")
@Api(value = "web",tags = {"web-客户列表"})
public class TBizMemberController {

    @Autowired
    private TBizMemberService memberService;

    @PostMapping("/list")
    @ApiOperation(value = "客户列表  √")
    public Result list(@Valid @RequestBody MemberListRequest request) {
        return memberService.list(request);
    }

    @PostMapping("/assign")
    @ApiOperation(value = "客户指派  √")
    public Result assign(@Valid @RequestBody AssignRequest request) {
        return memberService.assign(request);
    }

    @PostMapping("/followList")
    @ApiOperation(value = "跟进记录  √")
    public Result followList(@Valid @RequestBody FollowListRequest request) {
        return memberService.followList(request);
    }

    @PostMapping("/users")
    @ApiOperation(value = "获取销售列表  √")
    public Result getUsers(@Valid @RequestBody AssignRequest request) {
        return memberService.findUsersByRid(request);
    }

}

